﻿
@{
    ViewBag.Title = "Video";
}

<h2>Video</h2>

<script src="~/Scripts/SWFUpload/swfupload01.js"></script>


<div id="uploadinfo" class="public-upload">
    <div id="fsUploadProgress" class="fieldset flash"></div>
    <div id="divStatus" style="display: none"></div>
</div>
<span class="xiaoqutu-box">
    <i id="uploadRoomImg3" class="ml10 icon-local-upload"></i>
</span>
<script>
    //上传视频相关 start
    var settingsVideo = {
        flash_url: "/Scripts/SWFUpload/swfupload/swfupload700.swf",
        upload_url: "http://localhost:39663/image/UploadVideo",
        post_params: {},
        use_query_string: false,
        requeue_on_error: false,
        file_post_name: "Filedata",//后台获取视频的name
        file_size_limit: "10MB",//最大视频限制
        file_types: "*.MP4;",
        file_types_description: "JPG Images",
        file_upload_limit: 0,//上传个数  0 不做限制
        file_queue_limit: 0,
        custom_settings: {
            progressTarget: "fsUploadProgress"
        },
        debug: false,
        prevent_swf_caching: false,
        preserve_relative_urls: false,
        //上传按钮样式
        button_image_url: "/Scripts/SWFUpload/images/btn-local-img.png",
        button_width: "108",
        button_height: "36",
        button_placeholder_id: "uploadRoomImg3",
        button_cursor: SWFUpload.CURSOR.HAND,
        button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
        button_text: '',
        button_text_style: "",
        button_text_left_padding: 12,
        button_text_top_padding: 3,

        // 各种回调函数，除了roomImgUploadSuccess 在本页面下
        // 别的都在/Scripts/PageHelper/swfupload.js 下面
        file_queued_handler: fileQueued,
        file_queue_error_handler: fileQueueError,
        file_dialog_complete_handler: fileDialogComplete,
        upload_start_handler: uploadStart,
        upload_progress_handler: uploadProgress,
        upload_error_handler: uploadError,
        upload_success_handler: roomVideoUploadSuccess,
        upload_complete_handler: uploadComplete,
        queue_complete_handler: queueComplete,	// Queue plugin event
    }
    var swfVideo = new SWFUpload(settingsVideo);


    ///视频上传完成回调-Start
    function roomVideoUploadSuccess(file, serverData) {
        try {
            var progress = new FileProgress(file, this.customSettings.progressTarget);
            progress.setComplete();
            progress.setStatus("Complete.");
            progress.toggleCancel(false);
            //上面这四句是必须的，用来清楚提示信息


            console.log("上传成功");
        } catch (e) {
            this.debug(ex);
        }
    }
</script>